const path = require('path');
const webpack = require('webpack');
const merge = require('webpack-merge');
const base = require('./webpack.config.base');

const join = (filePath) => path.join(__dirname, '..', filePath);

base.plugins.push(new webpack.HotModuleReplacementPlugin());

const config = merge(base, {
  mode: 'development',
  devtool: 'cheap-module-eval-source-map',
  entry: {
    app: [
      'eventsource-polyfill',
      'webpack-hot-middleware/client?path=/__webpack_hmr&timeout=20000',
      join('src'),
    ],
  },
});

module.exports = config;